﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace CAATS_Registration
{
    public partial class ContactInfo : System.Web.UI.Page
    {
        public Int32 m_nIdx;
        protected void Page_Load(object sender, EventArgs e)
        {
 //           string strID = Parent.ID;

           string ii = Request.QueryString["from"];
           if (null == ii)
           {
               m_nIdx = -1;
           } 
           else
               m_nIdx = Convert.ToInt32(ii);
           save_data();
        }
        protected void save_data()
        {
            if (m_nIdx > 5)
                return;
            if (m_nIdx <= 0)
                return;
            dataRecord.Instance().m_listInfos[m_nIdx-1]._strFullName = NameInFull.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strTitle = TextTitle.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strFullAddress = txtAddress.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strStateOrganization = txtOrganization.Text;

            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strTel = txtACPhone.Text + txtPhonePart1.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strFax = txtACFax.Text  + txtFaxPart1.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strEmail = txtEmail.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strpassportNumber = txtPassportNumber.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strDateofIssue = txtDateOfIssue.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strDateofExpiry = txtDateOfExpiry.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strPRC = txtPRC_visa.Text;
            ListItem SelectedItem = DropDownList_Nationality.SelectedItem;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strNationality = SelectedItem.Text;
            dataRecord.Instance().m_listInfos[m_nIdx - 1]._strNationlityValue = DropDownList_Nationality.SelectedValue;
        }
        protected void NameInFull_TextChanged(object sender, EventArgs e)
        {
          

        }

        protected void txtDateOfIssue_TextChanged(object sender, EventArgs e)
        {

        }


        protected void TextTitle_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtCompany_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtAddress_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtOrganization_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtACPhone_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtPhonePart1_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtACFax_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtFaxPart1_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtEmail_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtPassportNumber_TextChanged(object sender, EventArgs e)
        {

        }

        protected void txtPRC_visa_TextChanged(object sender, EventArgs e)
        {

        }

        protected void DropDownList_Nationality_SelectedIndexChanged(object sender, EventArgs e)
        {
       
        }

        protected void Submit_Click(object sender, EventArgs e)
        {
            save_data();
            Label1.Visible = true;
        } 
    }
}
